class PuushIDGenerator
  CHARS = ("0".."9").to_a + ("a".."z").to_a + ("A".."Z").to_a
  
  def self.generate(&block)
    
    # this is really fuckin dirty atm, but you may optimize this if you want to
    
    # Example-ID: 12345
    
    # first char (1) Only Numbers at the moment. Should take a bit until chars are being used here
    ("1".."9").each do |char1|
      # second char (2)
      CHARS.each do |char2|
        # third char (3)
        CHARS.each do |char3|
          # fourth char (4)
          CHARS.each do |char4|
            # fifth char (5)
            CHARS.each do |char5|
              # combine se IDs
              id = char1 + char2 + char3 + char4 + char5
              # call se block
              block.call(id)
            end
          end
        end
      end
    end
  end
end